package com.quick.im.manager;

import com.quick.im.manager.interfaces.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@Slf4j
@SpringBootApplication
public class ManagerApplication implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication.run(ManagerApplication.class, args);
    }

    @Autowired
    private ApplicationContext applicationContext;

    @Override
    public void run(String... args) throws Exception {
        String[] beans = applicationContext.getBeanNamesForType(IUserService.class);
        for (String bean : beans) {
            log.info("Bean: " + bean);
        }
    }
}